using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Reflection;
using System.Web;

namespace Common.Context
{
    public class SessionContext
    {
        private static SessionContext instance = null;        

        public static SessionContext GetInstance()
        {
            if (SessionContext.instance == null)
            {
                SessionContext.instance = new SessionContext();
            }
            return SessionContext.instance;
        }

        
        public object GetValue(string key)
        {
            try
            {
				if (HttpContext.Current != null)
					return HttpContext.Current.Session[key];
				else
					return String.Empty;
            }
            catch (Exception ex)
            {
                return String.Empty;
            }

        }

        public void SetValue(string key, object value)
        {
            HttpContext.Current.Session[key] = value;        
        }
    }
}
